import axios from "~/axios"
import request from "~/utils/request"
// 新增或更新用户
export function saveUser(userData) {
    return request({
        url: '/user/edit',
        method: 'post',
        data: userData
    })
}

// 获取角色列表
export function getRoleList() {
    return request({
        url: '/role/list',
        method: 'get'
    })
}

// 获取用户列表
export function getUserList(params) {
    return request({
        url: '/user/list',
        method: 'get',
        params
    })
}

// 删除用户
export function deleteUser(id) {
    return request({
        url: `/user/delete/${id}`,
        method: 'delete'
    })
}
export const getUserPage = (pageNum, pageSize) => {
    return axios.get('/user/page', {params: { pageNum, pageSize }})
}
// 查询所有用户
export const findAllUsers = () => {
    return axios.get('/user/all')
}